package com.itheima.common;

/**
 * 基于ThreadLocal封装工具类，用于保护和获取当前登录id
 */
public class BaseContext {
    private static ThreadLocal<Long> threadLocal=new ThreadLocal();
    public static void setCurrentId(Long currentId){
        threadLocal.set(currentId);
    }
    public static Long getCurrentId(){
        return threadLocal.get();
    }
}